<?php $i=0;?>
<?php if(isset($_side_menu['children'])) :?>
<?php foreach($_side_menu['children'] as $idx=>$subMenu):?>
<?php if(check_auth($subMenu['label'])):?>
<?php ++$i;?>
<div class="side-bx<?php if($i==1):?> first<?php endif?>">
	<div class="side-bx-title">
		<h3><?php echo htmlspecialchars($subMenu['label']);?></h3>
	</div>
	<div class="side-bx-bd">
		<ul>
			<?php foreach($subMenu['children'] as $idx1=>$item):?>
            		<li><a target="<?php if(isset($item['_blank']) && $item['_blank']){ echo '_blank';}?>" href="<?php echo $item['link'];?>" mid="<?php echo $mainMid.$idx.$idx1?>"><?php echo htmlspecialchars($item['label']);?></a></li>
			<?php endforeach?>
		</ul>
	</div>
</div>
<?php endif?>
<?php endforeach?>
<?php endif?>
&nbsp;
<script>
	(function(){ 
		$$('.side-bx-title').addEvent('click', function(e){
			e.stop();
			var bx = this.getParent(),
			bd = this.getNext('.side-bx-bd');
			if(bx.hasClass('side-bx-toggled')){
				bd.show();
				bx.removeClass('side-bx-toggled');
			}else{
				bd.hide();
				bx.addClass('side-bx-toggled');
			}
		});
	})();
</script>